using System.Runtime.InteropServices;
using Baula.TextGen.ComAndVbeIntegration.ComInterfaces;

namespace Baula.TextGen.ComAndVbeIntegration
{
    [ComVisible(true)]
    [Guid("C5D971DB-DE91-4C8D-943D-77B274262560")]
    [ClassInterface(ClassInterfaceType.None)]
    public class Document : Framework.Document, IDocumentForCom
    {
        internal Document(Framework.DocumentTemplate documentTemplate) 
            : base(documentTemplate)
        { }

        void IDocumentForCom.AddPart(IPartForCom part)
        {
            Parts.Add((Framework.Part) part);
        }

        void IDocumentForCom.SetValueForPlaceholder(string placeholderName, string value)
        {
            ValuesForPlaceholders[placeholderName] = value;
        }

        public int PartCount
        {
            get { return Parts.Count; }
        }
    }
}